package com.atguigu.gulimall.product.service;

import com.atguigu.gulimall.product.entity.AttrEntity;
import com.atguigu.gulimall.product.entity.vo.AttrGroupRelationVo;
import com.atguigu.gulimall.product.entity.vo.AttrGroupVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.AttrGroupEntity;

import java.util.List;
import java.util.Map;

/**
 * 属性分组
 *
 * @author Syh
 * @email 1584442935@qq.com
 * @date 2022-02-07 14:29:04
 */
public interface AttrGroupService extends IService<AttrGroupEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 分页查询
     * @param params
     * @param categoryId
     * @return
     */
    IPage<AttrGroupEntity> selectPageInfo(Map<String, Object> params, String categoryId);

    //查询出id数组
    List<Long> selectCatelogPath(Long catelogId);

    /**
     * 获取属性分组关联的所有属性
     * @param attrgroupId
     * @return
     */
    List<AttrEntity> selectReletionattr(Long attrgroupId);

    /**
     * 删除属性的关联数据
     */
    void deleteReletionById(List<AttrGroupRelationVo> list);


    /**
     * 获取属性分组没有关联的其他属性
     * @param params
     * @param attrgroupId
     * @return
     */
    PageUtils selectRelationNoAttr(Map<String, Object> params, Long attrgroupId);

    //添加属性与分组的关联关系
    void saveRelation(List<AttrGroupRelationVo> attrGroupRelationVo);


    //查询分组以及该分组下的关联属性
    List<AttrGroupVo> selectRelationAndAttr(Long catelogId);
}

